<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://s3.pstatp.com/cdn/expire-1-M/jquery/3.2.1/jquery.min.js"></script>
<script>
    $(document).ready(function () {
        $("button").click(function () {
            var storage = window.localStorage;
            var id = storage.getItem("id");
            $.post({
                url: "/delayPayment/pay/" + id,
                success: function (result) {
                    if (result) {
                        window.location.href = 'success.html';
                    } else {
                        window.location.href = 'fail.html';
                    }
                }
            });
        });
    })
</script>
<body>
<button id="button">付款</button>
</body>
</html>